﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace TestApplication
{
	public partial class MainForm : Form
	{
		public MainForm()
		{
			InitializeComponent();
		}

		private void cmdTest_Click(object sender, EventArgs e)
		{
			cmdTest.Enabled = false;
			try
			{
				lstResults.Items.Clear();
				TesterClass t = new TesterClass();
				t.Complete += new EventHandler<TimedEventArgs>(t_Progress);
				t.Run();
			}
			catch (Exception ex)
			{
				throw;
			}
			finally
			{
				cmdTest.Enabled = true;
			}

		}

		private void t_Progress(object sender, TimedEventArgs e)
		{
			lstResults.Items.Add(e.Text + " - " + e.TotalMilliseconds + "ms");
		}

	}
}
